﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
// 引用MvvmLight
using GalaSoft.MvvmLight;

namespace LiveChartsTest.ViewModels
{
    class ChartsViewModel : ViewModelBase
    {
        public ChartsViewModel()
        {
           
        }
        // 继承MvvmLight的ViewModelBase利用RaisePropertyChanged做数据绑定
        public string BtnContent { get { return _BtnContent; } set { _BtnContent = value; RaisePropertyChanged("BtnContent"); } }
        private string _BtnContent = "Test";

        public tA A { get { return _A; } set { _A = value; RaisePropertyChanged("A"); } }
        private tA _A = new tA();

        // 利用Caliburn行为绑定
        public void BtnTestClick()
        {
            MessageBox.Show("调用成功");
        }

        public void BBaaa()
        {
            Trace.WriteLine(A.B[0].value1);
        }
    }

    public class tA
    {
        public List<tB> B { get; set; }
    }

    public class tB
    {
        public double value1 { get; set; }
    }
}
